Given a range [L, R], we need to find the count of total numbers of prime numbers in the range [L, R] where 0 <= L <= R < 10000. Consider that there are a large number of queries for different ranges.Examples:...
Given a range [L, R], we need to find the count of total numbers of prime numbers in the range [L, R] where 0 <= L <= R < 10000. Consider that there are a large number of queries for different ranges.Examples:...
Given a number ‘n’, check whether it is an emirpimes or not....
Given a number n, find the ordered prime signatures and using this find the number of divisor of given n. Any positive integer, ‘n’ can be expressed in the form of its prime factors. If ‘n’ has p1, p2, … etc. as its prime factors, then n can be expressed as : Now, arrange the obtained exponents of the prime factors of ‘n’ in non-decreasing order. The arrangement thus obtained is called the ordered prime signature of the positive integer ‘n’.Example:...
Given a string containing only lowercase english alphabets. The task is to find the bitwise XOR of all the prime frequencies of the characters in the string. If no prime frequency is present, then print -1....
Given Q queries where each query consists of an integer range [L, R], the task is to find the sum of the integers from the given range whose count of divisors is prime.Examples:...
Given K arrays where the first array contains the first prime number, the second array contains the next 2 primes and the third array contains the next 3 primes and so on. The task is to find the sum of primes in the Kth array.Examples:...
Given an array arr[] of size N. The task is to find the minimum number of swaps required to re-arrange the array such that all prime-indexed elements are prime, If the task can’t be achieved, print “-1“...
Given an array arr[] of size N and a positive integer K, the task is to find the sum of all array elements which are prime factors of K....
Given an integer N. The task is to find the sum of the first N prime numbers which don’t contain any odd primes as their digit.Some of such prime numbers are 2, 11, 19, 29, 41 …… Examples:...
Vantieghems Theorem is a necessary and sufficient condition for a number to be prime. It states that for a natural number n to be prime, the product of where , is congruent to . In other words, a number n is prime if and only if....